<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>下拉菜单</title>
    <link rel="stylesheet" href="/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
    <link rel="stylesheet" href="/css/formSelects-v4.css" />
</head>
<body>
<label class="layui-form-label">文章标签</label>
<div class="layui-input-inline" style="width: 56%;">
    <select name="tags" id="tags" lay-verify="required" xm-select="tags" xm-select-skin="normal">
        <option value="">请选择</option>
        <option value="1">随笔</option>
        <option value="2">测试</option>
        <option value="3">博客日志</option>
    </select>
</div>
<script src="/lib/layui-v2.5.5/layui.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    //全局定义一次, 加载formSelects
    layui.config({
        base: '/lib/layui-v2.5.5/' //此处路径请自行处理, 可以使用绝对路径
    }).extend({
        formSelects: 'formSelects-v4'
    });
    //加载模块
    layui.use(['jquery', 'formSelects'], function(){
        var formSelects = layui.formSelects;
         alert(formSelects.value('tags','val'))
    });
</script>
</body>
</html>